package com.zxl.common.utils;

import cn.hutool.core.util.IdUtil;
import org.apache.commons.lang3.StringUtils;

/**
 * @author zxw
 * @date 2023/3/31
 */
public class GoodsUtils {
    public static final String B_PREFIX = "B";

    public static String generatorGoodCode(String prefix) {
        StringBuilder sb = new StringBuilder();
        if (StringUtils.isBlank(prefix)) {
            prefix = B_PREFIX;
        }
        sb.append(prefix);
        sb.append(IdUtil.fastUUID().replaceAll("-", "").substring(0, 5));
        sb.append(System.currentTimeMillis());
        return sb.toString();
    }
}
